package com.cci.kangdao.dao;

import com.cci.kangdao.dao.model.ExternalAuthInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

@MapperScan
public interface ExternalAuthMapper {

    //根据来源和版本获取token
    @Select(" select\n" +
            "      top 1 et.AuthSource as authSource\n" +
            "      , et.Token as token\n" +
            "      , et.Version as version\n" +
            "      from ExternalAuth_T et\n" +
            "      where et.Flag = 0 and et.AuthSource = #{source} and et.Version = #{version}")
    ExternalAuthInfo getAuthBySource(@Param("source") String source, @Param("version") String version);
}